package com.gopay.common.domain.gsrt;
// Generated 2016-2-16 14:16:32 by Hibernate Tools 4.3.1.Final

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Entity: 签约
 */
@Entity
@Table(name = "GSRT_CUST_SIGNED")
public class GsrtCustSigned implements java.io.Serializable {
	/**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    // 签约状态标识位  01：签约成功 02：签约失败 03：待审核 04：失效 05：用户操作中
    public enum SignedState {
        SUCCESS("01", "签约成功"), FAIL("02", "签约失败"), CHECKPENDING("03", "待审核")
        , INVALID("04", "失效"), ONGOING("05", "用户操作中");

        private String code;
        private String name;

        private SignedState(String code, String name) {
            this.name = name;
            this.code = code;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static String getNameByCode(String code) {
            if (code == null) {
                return null;
            }
            for (SignedState flag : SignedState.values()) {
                if (flag.getCode().equals(code)) {
                    return flag.name;
                }
            }
            return null;
        }
    }

    /** 
     * 签约ID
     */
    private Long id;

    /** 
     * 用户ID
     */
    private String custId;

    /** 
     * 商户ID
     */
    private String merCustId;

    /** 
     * 商户订单号
     */
    private String merOrderId;

    /** 
     * p2p客户ID-----商户自己平台的客户ID
     */
    private String p2pCustId;

    /** 
     * 商户提交时间
     */
    private Date merTxnTm;

    /** 
     * 签约类别----是否为担保方：用户 01; 担保方 02
     */
    private String signedType;

    /** 
     * 国付宝交易日期
     */
    private Date gopayTxnTm;

    /** 
     * 国付宝订单号
     */
    private String gopayOrderId;

    /** 
     * 平台签约账户
     */
    private String trustAcct;

    /** 
     * 解约时间
     */
    private Date cancelDate;

    /** 
     * 签约状态---01：签约成功 02：签约失败 03：待审核(企业用户） 04：失效 05：用户操作中
     */
    private String signedState;

    /** 
     * 签约协议号---格式：数字、字母
     */
    private String constracterId;

    /** 
     * 签约完成日期
     */
    private Date tranFinishTime;

    /** 
     * 创建时间
     */
    private Date createdTs;

    /** 
     * 备注
     */
    private String remark;

    /** 
     * 记录最后修改时间
     */
    private Date lastUpdTs;

    /** 
     * 预留字段3
     */
    private String remark3;

    /** 
     * 预留字段2
     */
    private String remark2;

    /** 
     * 交易原因
     */
    private String commentRk;

    /** 
     * 乐观锁版本号
     */
    private Long version;
    /** 
     * 网关交易流水号
     */
    private Long transDtlSq;
    
    /**
     *  交易来源  09:PC ,  10:wap
     */
       private String gatewaySource;

    public GsrtCustSigned() {
    }

    @Id
    @SequenceGenerator(name = "GsrtCustSignedSequence", sequenceName = "GSRT_CUST_SIGNED_SEQ")
    @GeneratedValue(generator = "GsrtCustSignedSequence", strategy = GenerationType.SEQUENCE)
    @Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "CUST_ID", length = 10)
    public String getCustId() {
        return this.custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name = "MER_CUST_ID", nullable = false, length = 10)
    public String getMerCustId() {
        return this.merCustId;
    }

    public void setMerCustId(String merCustId) {
        this.merCustId = merCustId;
    }

    @Column(name = "MER_ORDER_ID", nullable = false, length = 30)
    public String getMerOrderId() {
        return this.merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    @Column(name = "P2P_CUST_ID", length = 30)
    public String getP2pCustId() {
        return this.p2pCustId;
    }

    public void setP2pCustId(String p2pCustId) {
        this.p2pCustId = p2pCustId;
    }

    @Column(name = "MER_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getMerTxnTm() {
        return this.merTxnTm;
    }

    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    @Column(name = "SIGNED_TYPE", nullable = false, length = 2)
    public String getSignedType() {
        return this.signedType;
    }

    public void setSignedType(String signedType) {
        this.signedType = signedType;
    }

    @Column(name = "GOPAY_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getGopayTxnTm() {
        return this.gopayTxnTm;
    }

    public void setGopayTxnTm(Date gopayTxnTm) {
        this.gopayTxnTm = gopayTxnTm;
    }

    @Column(name = "GOPAY_ORDER_ID", length = 30)
    public String getGopayOrderId() {
        return this.gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "TRUST_ACCT", length = 19)
    public String getTrustAcct() {
        return this.trustAcct;
    }

    public void setTrustAcct(String trustAcct) {
        this.trustAcct = trustAcct;
    }

    @Column(name = "CANCEL_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCancelDate() {
        return this.cancelDate;
    }

    public void setCancelDate(Date cancelDate) {
        this.cancelDate = cancelDate;
    }

    @Column(name = "SIGNED_STATE", length = 6)
    public String getSignedState() {
        return this.signedState;
    }

    public void setSignedState(String signedState) {
        this.signedState = signedState;
    }

    @Column(name = "CONSTRACTER_ID", length = 14)
    public String getConstracterId() {
        return this.constracterId;
    }

    public void setConstracterId(String constracterId) {
        this.constracterId = constracterId;
    }

    @Column(name = "TRAN_FINISH_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getTranFinishTime() {
        return this.tranFinishTime;
    }

    public void setTranFinishTime(Date tranFinishTime) {
        this.tranFinishTime = tranFinishTime;
    }

    @Column(name = "CREATED_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return this.createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "REMARK", length = 90)
    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return this.lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Column(name = "REMARK3", length = 50)
    public String getRemark3() {
        return this.remark3;
    }

    public void setRemark3(String remark3) {
        this.remark3 = remark3;
    }

    @Column(name = "REMARK2", length = 50)
    public String getRemark2() {
        return this.remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    @Column(name = "COMMENT_RK", length = 50)
    public String getCommentRk() {
        return this.commentRk;
    }

    public void setCommentRk(String commentRk) {
        this.commentRk = commentRk;
    }

    @Version
    @Column(name = "VERSION", precision = 22, scale = 0)
    public Long getVersion() {
        return this.version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }
	@Column(name = "TRANS_DTL_SQ", precision = 22, scale = 0)
	public Long getTransDtlSq() {
		return transDtlSq;
	}
	

	public void setTransDtlSq(Long transDtlSq) {
		this.transDtlSq = transDtlSq;
	}
	@Column(name = "GATEWAY_SOURCE", precision = 2, scale = 0)
	public String getGatewaySource() {
		return gatewaySource;
	}

	public void setGatewaySource(String gatewaySource) {
		this.gatewaySource = gatewaySource;
	}
}


	
	
